package com.study.bigwork.circle.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.study.bigwork.circle.dao.CircleDao;
import com.study.bigwork.entity.Circle;
import com.study.bigwork.entity.CircleComment;

@Service
@Transactional(readOnly=false)
public class CircleService {
	@Resource
	private CircleDao circleDao;
	public boolean addCircle(Circle circle) {
		circleDao.addCircle(circle);
		return true;
	}
	public List<Circle> getCircles(){
		return circleDao.getCircles();
		
	}
	
	
	public boolean addCircleComment(int circle_id,int comment_id,String comment) {
		return circleDao.addCircleComment(circle_id,comment_id,comment);
	}
	public List<CircleComment> getCircleComments(int circleId){
		return circleDao.getCircleComments(circleId);
	}
	public void addCommentSize(int id) {
		circleDao.addCommentSize(id);
	}
	public void reduceCommentSize(int id) {
		circleDao.reduceCommentSize(id);
	}
	public int deleteCommentById(int id) {
		return circleDao.deleteCommentById(id);
	}
	public int selectCircleIdById(int id) {
		return circleDao.selectCircleIdById(id);
	}
	
}